package com.home.webapp.monitor.entity;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.time.LocalDateTime;


/**
 * Description: 在线用户记录
 * Created by 王大宸 on 2020-10-12 22:27:31
 * Created with IntelliJ IDEA.
 */
@Table(name = "base_user_online")
public class BaseUserOnline implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    private String id;


    /**
     * 用户会话id
     */
    @Column(name = "session_id")
    private String sessionId;


    /**
     * 登录账号
     */
    @Column(name = "login_name")
    private String loginName;


    /**
     * 部门名称
     */
    @Column(name = "dept_name")
    private String deptName;


    /**
     * 登录IP地址
     */
    @Column(name = "ipaddr")
    private String ipaddr;


    /**
     * 登录地点
     */
    @Column(name = "login_location")
    private String loginLocation;


    /**
     * 浏览器类型
     */
    @Column(name = "browser")
    private String browser;


    /**
     * 操作系统
     */
    @Column(name = "os")
    private String os;


    /**
     * 在线状态on_line在线off_line离线
     */
    @Column(name = "status")
    private String status;


    /**
     * session创建时间
     */
    @Column(name = "create_time")
    private LocalDateTime createTime;


    /**
     * session最后访问时间
     */
    @Column(name = "last_access_time")
    private LocalDateTime lastAccessTime;


    /**
     * 超时时间，单位为分钟
     */
    @Column(name = "expire_time")
    private Integer expireTime;


    /**
     * 用户ID
     */
    @Column(name = "create_user_id")
    private String createUserId;


    /**
     * 登录用户
     */
    @Column(name = "create_user")
    private String createUser;

    /**
     * 客户端id
     */
    @Column(name = "client_id")
    private String clientId;

    public String getClientId() {
        return clientId;
    }

    public void setClientId(String clientId) {
        this.clientId = clientId;
    }


    public void setId(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }

    public String getSessionId() {
        return sessionId;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    public String getLoginName() {
        return loginName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    public String getDeptName() {
        return deptName;
    }

    public void setIpaddr(String ipaddr) {
        this.ipaddr = ipaddr;
    }

    public String getIpaddr() {
        return ipaddr;
    }

    public void setLoginLocation(String loginLocation) {
        this.loginLocation = loginLocation;
    }

    public String getLoginLocation() {
        return loginLocation;
    }

    public void setBrowser(String browser) {
        this.browser = browser;
    }

    public String getBrowser() {
        return browser;
    }

    public void setOs(String os) {
        this.os = os;
    }

    public String getOs() {
        return os;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getStatus() {
        return status;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setLastAccessTime(LocalDateTime lastAccessTime) {
        this.lastAccessTime = lastAccessTime;
    }

    public LocalDateTime getLastAccessTime() {
        return lastAccessTime;
    }

    public void setExpireTime(Integer expireTime) {
        this.expireTime = expireTime;
    }

    public Integer getExpireTime() {
        return expireTime;
    }

    public void setCreateUserId(String createUserId) {
        this.createUserId = createUserId;
    }

    public String getCreateUserId() {
        return createUserId;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    public String getCreateUser() {
        return createUser;
    }

    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("sessionId", getSessionId())
                .append("loginName", getLoginName())
                .append("deptName", getDeptName())
                .append("ipaddr", getIpaddr())
                .append("clientId", getClientId())
                .append("loginLocation", getLoginLocation())
                .append("browser", getBrowser())
                .append("os", getOs())
                .append("status", getStatus())
                .append("createTime", getCreateTime())
                .append("lastAccessTime", getLastAccessTime())
                .append("expireTime", getExpireTime())
                .append("createUserId", getCreateUserId())
                .append("createUser", getCreateUser())
                .toString();
    }

}
